package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.ImproveB231;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class ImproveB231Converter implements AttributeConverter<ImproveB231, String> {
    @Override
    public String convertToDatabaseColumn(ImproveB231 functionTest) {
        return JSONUtil.toJsonStr(functionTest);
    }

    @Override
    public ImproveB231 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, ImproveB231.class);
    }
}
